exports.MMFloorModel = Core.Class.subclass(
{
	classname:'MMFloorModel',
								   
    initialize: function(floorModel) 
    {
    	this._floorObj = null;
    	
    	if(floorModel) {
    		this._floorObj = floorModel;
    	} else {
    		this._floorObj = {"floorId": 1,"mallId": 1,"constructionTime": -1,"itemId" : "2_1_1"};
    	}
    },
    
    getConstructionRemainingTime: function()
    {
    	if(this.getConstructionTime() > 0)
    	{
    		var currentTime = MMGameState.getServerTime();
    		var difference = currentTime - this.getConstructionTime();
    		var remainingTime = 2 - difference; 
    		if( remainingTime > 0 )
    		{
    			return remainingTime;
    		}
    	}
    	return 0;
    },
    
    getFloorId: function()
    {
    	if(this._floorObj)
    	{
    		return this._floorObj.floorId;
    	}
    	return null;
    },
    
    getItemId: function()
    {
    	if(this._floorObj)
    	{
    		return this._floorObj.itemId;
    	}
    	return null;    	
    },
    
    setItemId: function(itemId)
    {
    	this._floorObj.itemId = itemId;
    },
    
    getConstructionTime: function()
    {
    	if(this._floorObj)
    	{
    		return this._floorObj.constructionTime;
    	}
    	return -1;
    },
    
    setConstructionTime: function(constructionTime)
    {
    	if(this._floorObj && typeof constructionTime != 'undefined')
    	{
    		this._floorObj.constructionTime = constructionTime;
    	}
    },
    
    updateModel: function()
	{
		MMGameState.getCurrentUser().updateModel();
	},
    						   
	destroy: function()
	{
		this._floorObj = null;	
	},
});